package PTA2.ti22;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int number = scanner.nextInt();
        int hundred = number / 100;
        int ten = (number%100) / 10;
        int unit = number% 10;
        int sum = hundred + ten + unit;
        System.out.println(sum);
        scanner.close();
    }
}
